<template>
  <div>
    <Search :tipsKeys="tipKeys" :hotKeys="hotKeys" v-on:go-back="goBack" v-on:search="search"></Search>
  </div>
</template>

<script>
  import search from '@/components/search';
  import { SEARCH_SET_VALUE } from '../../store/mutation-types';
  export default {
    components: {
      Search: search
    },
    data() {
      return {
        obj: {},
        tipKeys: ['书法绘画', '英语口才', '舞蹈跆拳', '音乐戏剧', '国象围棋', '科学探索', '亲子活动', '华时教育', '济南'],
        hotKeys: []
      };
    },
    methods: {
      goBack() {
        this.goBackAndSendValue('');
      },
      search(value) {
        this.goBackAndSendValue(value);
      },
      goBackAndSendValue(value) {
        this.$store.dispatch('search/' + SEARCH_SET_VALUE, value);
        // wx.navigateBack();
        wx.redirectTo({
          url: '/pages/index/searchvalue'
        });
      }
    }
  };
</script>
